package com.xinyu.service.impl;

import com.xinyu.domain.Words;
import com.xinyu.mapper.WordsMapper;
import com.xinyu.service.IWordsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinyu.vo.BaseResult;
import com.xinyu.vo.WordsRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author l
 * @since 2025-02-20
 */
@Service
public class WordsServiceImpl extends ServiceImpl<WordsMapper, Words> implements IWordsService {

    @Autowired
    private WordsMapper wordsMapper;

    @Override
    public BaseResult queryByCondition(WordsRequest wordsRequest) {
        List<Words> words = wordsMapper.queryByCondition(wordsRequest);
        Integer wordsCounts = wordsMapper.wordsCounts(wordsRequest);
        return BaseResult.ok(words,wordsCounts);
    }
}
